# python就是字典
def dictionDemo():
    alion = {'color': 'green', 'points': 5}
    for ain in alion:
        print( ain )
    print( alion["points"] )


def dictionAdd():
    sex = {}
    sex['neizhang'] = 'dde'
    sex['xiaoming'] = 'ddx'
    print( sex )


def dictionUpdate():
    names = {"张三": "牛逼"}
    names["张三"] = '开心'
    print( names )


def dictionFor():
    nases = {"小明": "开心", "小红": "开心", "小张": "开心"}
    for key, value in nases.items():
        print( key, value )
        # print(value)


# 嵌套字典
def dictionofdiction():
    alien_0 = {'color': 'green', 'points': 5}
    alien_1 = {'color': 'yellow', 'points': 10}
    alien_2 = {'color': 'red', 'points': 15}
    aliens = [alien_0, alien_1, alien_2]
    for alien in aliens:
        print( alien )


def dictionOflist():
    anlin_0 = {'color': "green", "lists": ["张san", "芜湖"]}

    for list in anlin_0['lists']:
        print( list )


if __name__ == '__main__':
    print( "测试" )
    dictionDemo()
    dictionAdd()
    dictionUpdate()
    dictionFor()
    dictionofdiction()
    dictionOflist()
